package com.jk.lzy.controller;

import com.jk.*;
import com.jk.lzy.service.MovieInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;

/**
 * @Author: 梁展艺
 * @Description:  选座购票
 * @Date: 2021/5/21 10:22
 * @param null
 * @Return:
 **/
@RestController
public class MovieInfoController implements com.jk.service.MovieInfoService {

    @Autowired
    private MovieInfoService lzyTicketService;
    /**
     * @Author: 梁展艺
     * @Description:  购票 影院信息回显
     * @Date: 2021/5/21 11:15
     * @param cinemaId
     * @Return: com.jk.CinemaBean
     **/
    @Override
    public CinemaBean chooseByCinemaId(Integer cinemaId){ // 传 影院的 id
        return lzyTicketService.chooseByCinemaId(cinemaId);
    }
    /**
     * @Author: 梁展艺
     * @Description:  首页点击购票  展示影院详情
     * @Date: 2021/5/21 16:23
     * @param movieId
     * @Return: com.jk.MovieBean
     **/
    @Override
    public MovieBean movieDetailsBy(Integer movieId){
        return lzyTicketService.movieDetailsBy(movieId);
    }
    /**
     * @Author: 梁展艺
     * @Description: 购票 根据 市 查询 影院
     * @Date: 2021/5/21 20:33
     * @param cinema
     * @Return: java.util.List<com.jk.CinemaBean>
     **/
    @Override
    public List<CinemaBean> cinemaByCity(CinemaBean cinema){
        return lzyTicketService.cinemaByCity(cinema);
    }
    /**
     * @Author: 梁展艺
     * @Description: 根据影院查看电影
     * @Date: 2021/5/24 19:37
     * @param cinemaId
     * @Return: java.util.List<com.jk.MovieBean>
     **/
    @Override
    public MovieBean movieByCinema(Integer movieId) {
        return lzyTicketService.movieByCinema(movieId);
    }
    /**
     * @Author: 梁展艺
     * @Description: 影院电影放映 安排
     * @Date: 2021/5/25 20:09
     * @param program
     * @Return: java.util.List<com.jk.ProgramBean>
     **/
    @Override
    public List<ProgramBean> moviePlan(ProgramBean program) {
        return lzyTicketService.moviePlan(program);
    }
    /**
     * @Author: 梁展艺
     * @Description: 选座 回显放映计划
     * @Date: 2021/5/26 11:28
     * @param programId
     * @Return: com.jk.ProgramBean
     **/
    @Override
    public ProgramBean programByprogramId(Integer programId) {

        return lzyTicketService.programByprogramId(programId);
    }
    /**
     * @Author: 梁展艺
     * @Description:  座位描述
     * @Date: 2021/5/27 10:30
     * @param programId
     * @Return: com.jk.MovieHallBean
     **/
    @Override
    public HashMap seatInfo(Integer programId) {
        return lzyTicketService.seatInfo(programId);
    }
    /**
     * @Author: 梁展艺
     * @Description: 生成订单
     * @Date: 2021/5/28 21:30
     * @param programId
     * @param user
     * @Return: java.lang.String
     **/
    @Override
    public OrderBean createOrder(Integer programId, String state, Double orderPrice,@RequestBody UserBean user) {
        OrderBean order = lzyTicketService.createOrder(programId,state,orderPrice,user);
        return  order;
    }
    /**
     * @Author: 梁展艺
     * @Description: 限时支付 页面 订单描述
     * @Date: 2021/5/31 16:12
     * @param orderBean
     * @Return: com.jk.OrderBean
     **/
    @Override
    public OrderBean orderInfoByOrder(OrderBean orderBean) {
        OrderBean order = lzyTicketService.orderInfoByOrder(orderBean);
        return order;
    }
}
